package com.cmb.lk50.pojo;

import com.cmb.lk50.sink.db.StatementGenerator;
import org.springframework.stereotype.Component;

import java.sql.PreparedStatement;
import java.sql.SQLException;

/**
 * Author       : 蒋俊钊 80256973
 * Date         : 2020/8/26
 * Copyright    (C) ChinaMerchantsBank
 */
@Component
public class NameMapper implements StatementGenerator.LogMapper<CustomBody> {

    @Override
    public void customer(PreparedStatement preparedStatement, CustomBody log) throws SQLException {
        preparedStatement.setString(1, log.name);
    }

    @Override
    public String getSql() {
        return "insert into test (host_name) values (?)";
    }
}
